<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>设备管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        $(document).ready(function() {
            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function(form){
                    loading('<spring:message code="common.subbmiting"/>');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });
	</script>
</head>
<body>
<ul class="nav nav-tabs">
	<li><a href="${ctx}/equipment/eleEquipmentNocheck/">设备列表</a></li>
	<li class="active">
		<a href="${ctx}/equipment/eleEquipmentNocheck/form?id=${eleEquipmentNocheck.id}">设备<spring:message code="common.add"/></a>
	</li>
</ul><br/>
<form:form id="inputForm" modelAttribute="eleEquipmentNocheck" action="${ctx}/equipment/eleEquipmentNocheck/save" method="post" class="form-horizontal">
	<form:hidden path="id"/>
	<sys:message content="${message}"/>
	<div class="control-group">
		<label class="control-label"><spring:message code="common.device.id"/></label>
		<div class="controls">
			<form:input path="code" htmlEscape="false" maxlength="255" class="input-xlarge "/>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label"><spring:message code="common.group.branchoffice"/>：</label>
		<div class="controls">
			<shiro:hasRole name="admin">
				<c:if test= "${not empty eleEquipment.id}"><sys:treeselect id="company" name="company.id" value="${eleEquipmentNocheck.company.id}" labelName="company.name"
								labelValue="${eleEquipmentNocheck.company.name}"
								title="公司" url="/sys/office/treeData?type=1" cssClass="required" allowInput="false"/></c:if>
					<c:if test= "${empty eleEquipment.id}"><sys:treeselect id="company" name="company.id" value="" labelName="company.name"
								labelValue=""
								title="公司" url="/sys/office/treeData?type=1" cssClass="required" allowInput="false"/></c:if>				
				<span class="help-inline"><font color="red">*</font> </span>
			</shiro:hasRole>
			<shiro:lacksRole name="admin">
				<input id="companyId" name="company.id" value="${eleEquipmentNocheck.company.id}" type="hidden">
				<input id="companyName" name="company.name" value="${eleEquipmentNocheck.company.name}" type="hidden">
				<label class="lbl">${eleEquipmentNocheck.company.name}</label>
			</shiro:lacksRole>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label"><spring:message code="common.group.group"/>：</label>
		<div class="controls">
			<shiro:hasPermission name="equipment:eleEquipment:check">
				<sys:treeselect id="office" name="office.id" value="${eleEquipmentNocheck.office.id}" labelName="office.name"
								labelValue="${eleEquipmentNocheck.office.name}" title="部门"
								url="/sys/office/treeData?type=2" cssClass="required" notAllowSelectParent="false" allowInput="false" disabled="disabled"/>
				<span class="help-inline">
					<font color="red">*</font> </span>
			</shiro:hasPermission>
			<shiro:lacksPermission name="equipment:eleEquipment:check">
				<input id="companyId" name="office.id" value="${eleEquipmentNocheck.office.id}" type="hidden">
				<input id="companyName" name="office.name" value="${eleEquipmentNocheck.office.name}" type="hidden">
				<label class="lbl">${eleEquipmentNocheck.office.name}</label>
			</shiro:lacksPermission>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label"><spring:message code="menu.device.Equipment_Type"/>：</label>
		<div class="controls">
			<sys:treeselect id="type" name="type.id" value="${eleEquipmentNocheck.type.id}"
							labelName="type.name" labelValue="${eleEquipmentNocheck.type.name}"
							title="<spring:message code='menu.device.Equipment_Type'/>" url="/equipment/eleEquipmentType/treeData" cssClass="required"/>
			<span class="help-inline"><font color="red">*</font></span>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label"><spring:message code='common.resolution'/>：</label>
		<div class="controls">
			<form:input path="width" htmlEscape="false" maxlength="255" class="input-mini digits" />
			*
			<form:input path="height" htmlEscape="false" maxlength="255" class="input-mini digits"/>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label"><spring:message code='common.remarks'/>：</label>
		<div class="controls">
			<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="input-xxlarge "/>
		</div>
	</div>
	<div class="form-actions">
		<shiro:hasPermission name="equipment:eleEquipmentNocheck:view"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保  存"/>&nbsp;</shiro:hasPermission>
		<input id="btnCancel" class="btn" type="button" value="取  消" onclick="history.go(-1)"/>
	</div>
</form:form>
</body>
</html>